-
Notifications
You must be signed in to change notification settings - Fork 0
Sync ErrorProne configuration with OpenTelemetry Java instrumentation #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: trask <[email protected]>
| // TODO: Remove this, we use this pattern in several tests and it will mean some moving. | ||
| disable("DefaultPackage") | ||
|
|
||
| // We don't have custom checks like OpenTelemetry, so disable the standard utility class check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the custom checks from OpenTelemetry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This repository doesn't have custom checks like OpenTelemetry, so I've kept the standard disable for PrivateConstructorForUtilityClass instead of adding non-existent custom checks.
Co-authored-by: trask <[email protected]>
…#93) * Initial plan * Sync errorprone configuration with OpenTelemetry instrumentation Co-authored-by: trask <[email protected]> * Address review feedback for ErrorProne configuration Co-authored-by: trask <[email protected]> * Update settings.gradle.kts --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: trask <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
This PR synchronizes the ErrorProne configuration in Application Insights Java with the upstream OpenTelemetry Java instrumentation repository to ensure consistent code quality standards and take advantage of improvements made upstream.
Key Changes
Enhanced Configuration
testLatestDepssupport for future compatibility with latest dependency testing workflowsconcurrentlinkedhashmapand other vendored code patternsAdditional Disabled Checks (synced from OpenTelemetry)
PreferredInterfaceType- We often override methods returning Iterable; this makes it tedious for questionable valueImmutableRefactoring- Suggests using com.google.errorprone.annotations.Immutable vs javax.annotation.concurrent.ImmutableUnnecessarilyFullyQualified- Fully qualified names may be necessary when deprecating classesJava8ApiChecker- TODO: use animal sniffer insteadInitializeInline- Prevents lazy initialization patternsInlineMeSuggester- Triggers even when deprecated methods aren't calledDoNotCallSuggester- Can be overly restrictiveFieldMissingNullable,ParameterMissingNullable, etc.) - We have nullaway, don't need errorprone nullable checks with more false positivesTypeParameterNaming- Allow UPPERCASE type parameter namesMustBeClosedChecker- In bytecode instrumentation it's common to separate across onEnter/onExitMixedMutabilityReturnType- Common to avoid allocationJdkObsolete- We end up using obsolete types if libraries we're instrumenting use themDefaultPackage- We use this pattern in several testsPrivateConstructorForUtilityClass- Was missing explicit disableAvoidObjectArrays- Low-level APIs use arraysBanClassLoader- Needed for agent functionalityPreserved Application Insights Specific Configuration
MissingSummary,UnnecessaryDefaultInEnumSwitchJavaDurationGetSecondsToToSecondsdisable for Java 9+ featuresBuild Fixes
com.github.ben-manes.versionsplugin version to resolve build configuration issuesTesting
This brings our ErrorProne configuration in line with the upstream OpenTelemetry project while preserving Application Insights-specific requirements.
Fixes #92.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.